/* 云当铺新商城2.0接口 */
import request from "@/utils/request";

/*
 * 首页接口
 * */
export function getHomeActivities() {
  return request.get('/sy/shop/home/activities/index')
}

/*
 * 支付宝双v流量埋点
 * */
export function setAlipayFlowIndex(data) {
  return request.get('/sy/shop/setAlipay/flow/index', data)
}

/*
 * 单独获取限时捡漏时间接口
 * */
export function getShopHomeLimitTime() {
  return request.get('/sy/shop/home/getLimitTime')
}

/*
 * 去寄存品类接口
 * */
export function getInfoByCategoryList() {
  return request.get('/sy/depositOrRecycle/getInfoByCategoryList')
}

/*
 * 去寄存获取当前分类信息接口
 * */
export function getCategoryInfoByPid(id) {
  return request.get('/sy/depositOrRecycle/getCategoryInfoByPid/?pid=' + id)
}

/*
 * 发送验证码
 * */
export function registerVerify(data) {
  return request.post('/sy/register/verify', data)
}

/*
 * 提交寄存单
 * */
export function submitOrderInfo(data) {
  return request.post('/sy/depositOrRecycle/submitOrderInfo', data)
}

/*
 * 商城数据接口
 * */
export function getShopNumberList(type) {
  return request.get(`/sy/mall/home/number/index/${type}`)
}

/*
 * 商城筛选列表数据
 * */
export function getShopProductsList(data) {
  return request.get('/sy/shop/getProducts/list', data)
}

/* 首页9.9包邮、精品推荐banner配置 */
export function getHomeLimitTimeSetting(order) {
  return request.get(`/sy/mall/home/limitTime/pageSetting/${order}`)
}

/* 首页9.9包邮、精品推荐数据列表 */
export function getHomeLimitTimeList(data) {
  return request.get('/sy/mall/home/limitTime/page/list', data)
}

/* 搜索中间页-热门搜索 */
export function getHotSearchData() {
  return request.get(`/sy/shop/search/keyword`)
}

/* 搜索结果页-顶部一级分类 */
export function getShopFirstList() {
  return request.get('/sy/shop/mall/getCateFirstList')
}

/* 搜索结果页获取商品 */
export function getShopProductsLists(data) {
  return request.get('/sy/shop/getProducts/list', data)
}

/* 商品详情页点击收藏 */
export function doShopProductsAdd(id, category) {
  return request.post('/sy/shop/collect/add', {
    id: id,
    category: category,
  })
}

/* 商品详情页取消收藏 */
export function doShopProductsDel(id, category) {
  return request.post('/sy/shop/collect/del', {
    id: id,
    category: category,
  })
}

/* 收藏列表 */
export function getShopCollectList(data) {
  return request.get('/sy/shop/collect/user', data)
}

/* 收藏列表批量取消收藏 */
export function getShopCollectBatchDel(productIds) {
  return request.post('/sy/shop/collect/batch/del', {
    productIds: productIds
  })
}

/* 商品筛选 */
export function getShopScreenList(data) {
  return request.get('/sy/shop/screen/conditionList', data)
}

/* 盲盒列表 */
export function getBlindBoxList(id) {
  return request.get(`/sy/shop/blindBoxList/${id}`)
}

/* 招商加盟列表 */
export function getBusinessList(data) {
  return request.get('/sy/business/cooperate/list', data || {})
}

/* 招商加盟列表跟进 */
export function getBusinessFollowSubmit(data) {
  return request.post('/sy/business/cooperate/follow/submit', data || {})
}

/* 招商加盟列表详情页 */
export function getBusinessDetails(id) {
  return request.get(`/sy/business/cooperate/getDetails/${id}`)
}

/* 招商加盟详情页客服提交是否有效 */
export function getEffectiveStatus(data) {
  return request.post('/sy/business/cooperate/effectiveStatus/submit', data)
}

/* 招商加盟详情页客服提交线索处理状态 */
export function getClueStatusSubmit(data) {
  return request.post('/sy/business/cooperate/clueStatus/submit', data)
}

/* 招商加盟填表申请 */
export function getCooperateSubmit(data) {
  return request.post('/sy/business/cooperate/submit', data)
}

export function getCooperateList() {
  return request.get('/sy/shop/business')
}